package util;

/**
 * @Classname ConffigFileName
 * @Description 存储各文件名称
 * @Date
 * @Created by kevin
 */
public class ConfigFileName {
    private String dir ;
    private String pairingParametersFileName;      //群配置信息
    private String CSPUAKFileName ;              //用户属性认证密钥
    private String GPFileName ;             //
    private String AAPKFileName ;
    private String AASKFileName ;            //系统主密钥
    private String RSUSKFileName ;
    private String UserSKFileName ;    //用户身份密钥
    private String UserPKFileName;     //用户身份公钥
    private String UserUAKFileName; //用户属性认证密钥
    private String CtFileName ;                  //密文
    private String TKFileName ;                  //转换密钥
    private String revokeListFileName ;   //撤销列表
    private String AccountListFileName ;   //撤销列表
    private String secretFileName ;
    private String AccountCtFileName;
    public ConfigFileName(){
        this.dir = "Scheme-1-";
        this.pairingParametersFileName = "a.properties";
        this.CSPUAKFileName = dir + "CSPuak.properties";
        this.GPFileName = dir + "GP.properties";
        this.AAPKFileName = dir + "AApk.properties";
        this.AASKFileName = dir + "AAsk.properties";
        this.RSUSKFileName = dir + "RSU_SK.properties";
        this.UserSKFileName = dir + "UserSK.properties";
        this.UserPKFileName = dir + "UserPK.properties";
        this.UserUAKFileName = dir + "UserUAK.properties";
        this.CtFileName = dir + "ct.properties";
        this.TKFileName = dir + "TK.properties";
        this.revokeListFileName = dir +"revokeList.properties";     //撤销列表
        this.AccountListFileName = dir +"AccountList.properties";     //追责列表
        this.secretFileName = dir + "secret.properties";
        this.AccountCtFileName = dir + "AccountCt.properties";

    }
    public String getPairingParametersFileName(){
        return pairingParametersFileName;
    }
    public String getCSPUAKFileName(){
        return CSPUAKFileName;
    }
    public String getGPFileName(){
        return GPFileName;
    }
    public String getAAPKFileName(){
        return AAPKFileName;
    }
    public String getAASKFileName(){
        return AASKFileName;
    }
    public String getUserSKFileName(){
        return UserSKFileName;
    }
    public String getUserUAKFileName(){
        return UserUAKFileName;
    }
    public String getUserPKFileName(){
        return UserPKFileName;
    }
    public String getCtFileName(){
        return CtFileName;
    }
    public String getTKFileName(){
        return TKFileName;
    }
    public String getRevokeListFileName(){
        return revokeListFileName;
    }
    public String getAccountListFileName(){
        return AccountListFileName;
    }
    public String getSecretFileName(){
        return  secretFileName ;
    }
    public String getRSUSKFileName(){
        return  RSUSKFileName ;
    }
    public String getAccountCtFileName(){
        return  AccountCtFileName ;
    }
    /**
     * 返回管理该属性的aid
     * @param att
     * @param aaNums
     * @return aid
     */
    public static int getAidOfAtt(String att,int aaNums,int attListLen)  {
        /********************************************获取公共参数********************************************************/
        int aid = 0;
        int aveLen = attListLen/aaNums;
        int attNo = Integer.parseInt(att);
        aid = attNo/aveLen+1;
        return aid;
    }

}
